<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>玩家充值</title>
<meta name="Keywords" content="">
<meta name="Description" content="">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MobileOptimized" content="240">

<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">        
<!-- Mobile Devices Support @begin -->
  
  <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
  <meta content="no-cache" http-equiv="pragma">
  <meta content="0" http-equiv="expires">
  <meta content="telephone=no, address=no" name="format-detection">
  <meta name="apple-mobile-web-app-capable" content="yes"> <!-- apple devices fullscreen -->
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><!-- Mobile Devices Support @end -->
<link rel="stylesheet" type="text/css" href="__CSS__/public.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<!-- <link rel="stylesheet" type="text/css" href="style_re.css" media="all"> -->

</head>
<style type="text/css">
.dv{
  width: 80%;
  height: 330px;
  /*border: solid 1px red;*/
  margin: 80px auto;
  padding:20px;
  background: #fff;
  border-radius: 10px;
}
.dv h2{
	text-align: center;
	font-size: 23px;
	font-family: "微软雅黑";
	margin-bottom: 20px;
}
.dv #form1{
	width: 100%；
	height：100%；
	font-size:18px;
}
.dv #form1 .d2{
	width: 100%;
	height: 50px;
	line-height: 50px;
	border-bottom: solid 1px #eeeeee;
}
.dv #form1 .d2 input{
	border-style:none;
	/*float: right;*/
	/*text-align:right;*/
	/*width: 70px;*/
	font-size: 18px;
}
.dv #form1 .d2 span{
	float: right;
	margin-right: 10px;
	font-size: 18px;
}	
.dv #form1 .d2 label{
	margin-left: 10px;
	font-size: 18px;
}
.dv #form1 .d3{
	width: 100%;
	height: 30px;
	margin-top: 25px;
}
.dv #form1 .d3 input{
	width: 100%;
	height: 40px;
	font-size: 18px;
	background: #6eb23f;
	color: #fff;
	border: solid 1px #6eb23f;
    border-radius: 5px;
}
</style>

<body class="body" style="background: #333">
	<div class="page_top_box" style="background: green;z-index: 99">
    <center>
        <div class="page_top">
            <!-- <a href="<?php echo '__ROOT__/index.html' ?>" class="back"> -->
            <div class="pg_name" onclick="location.reload()">玩家充值</div>
        </div>
    </center>
    </div>
    
    <div class="dv">
        <h2>充值</h2>
		<form id="form1" name="form1" method="post" action="<?php echo "Userrecharge.html?action=tj&userId=",$userId."&money=",$money."&goodsNum=",$goodsNum."&type=",$type."&give=",$give; ?>" >
		   <div class="d2"><label style="color: #a39e9e">商品信息</label><span style="color: #a39e9e"><input type="text" value="<?php echo $goodsNum; ?>" readonly="readonly" style="width: 55px;color: #a39e9e">     <?php echo $unit; ?></span></div>
		   <div class="d2"><label style="color: #a39e9e">赠送信息</label><span style="color: #a39e9e"><input type="text" value="<?php echo $give; ?>" readonly="readonly" style="width: 55px;color: #a39e9e">     <?php echo $unit; ?></span></div>
		   <div class="d2"><label style="color: #a39e9e">玩家信息</label><span style="color: #a39e9e"><input type="text" value="<?php echo $userId; ?>" readonly="readonly" style="width: 70px;position: relative;right: 25px;height:50px;color: #a39e9e"></span></div>
		   <div class="d2"><label class="">需付款</label><span style="position: relative;right: 23px;color: #f3981c"><input type="text" value="<?php echo $money; ?>" readonly="readonly" style="width: 55px;color: #f3981c">元</span></div>
		   <div class="d3"><input type="submit" value="继续支付"></div>
		</form>
	</div>
</body>
</html> 

<?php
	if($_GET['action']=="tj")
	{	
		/*
		$customerid='155038';
		$sdcustomno = strtoupper(dechex(date('m'))).date('d').substr(time(),-5).substr(microtime(),2,5).sprintf(rand(0,99));
		$orderAmount = $money * 100;
		$cardno='41';
		$backurl='http://'.$_SERVER['SERVER_NAME'].'/zy_agent/payoff_mobile.html';
		$noticeurl='http://'.$_SERVER['SERVER_NAME'].'/zy_agent/payoff_mobile_callback.html';
		$key='244ca72c106b8eef6c27f2e97bfd93ee';
		$mark='coinsforplayers';
		$goods_name='包房钻石数';
		if ($type == 1 || $type == "1"){
			$goods_name='自由场酒豆数';
		}
		$order_gems = $goodsNum;
		$Md5str='customerid='.$customerid.'&sdcustomno='.$sdcustomno.'&orderAmount='.$orderAmount.'&cardno='.$cardno.'&noticeurl='.$noticeurl.'&backurl='.$backurl.$key;
		$oper_account=$userId;
		
		if($oper_account==""){
			login('您好，请先登录');
		}else
		{
			$sign=strtoupper(md5($Md5str));
			$gourl='http://www.zhifuka.net/gateway/weixin/wap-weixinpay.asp?customerid='.$customerid.'&sdcustomno='.$sdcustomno.'&orderAmount='.$orderAmount.'&cardno='.$cardno.'&noticeurl='.$noticeurl.'&backurl='.$backurl .'&sign='.$sign.'&mark='.$mark;
			M("","","DB_CONFIG0")->execute("insert into yp_apply_order(oper_account,customer_id,order_no,order_money,pay_mode,goods_type,mark,goods_name,sign,order_gems)values('$oper_account','$customerid','$sdcustomno','$orderAmount','$cardno','$type','$mark','$goods_name','$sign','$order_gems')");
			echo "<script language=\"javascript\">";
			echo "document.location=\"".$gourl."\"";
			echo "</script>";
		}*/	
		
		$domain_url = "https://api.dq.cn/pay/KDBank.aspx";
		$sdcustomno= strtoupper(dechex(date('m'))).date('d').substr(time(),-5).substr(microtime(),2,5).sprintf(rand(0,99));
		$P_CardId = "";
		$P_CardPass = "";
		$orderAmount = $money/10;
		$P_Description = "";
		$P_ChannelId = 33;
		$P_UserId = 1002067;
		$SafeStr = "8c0b32e281e9481c8daadc1e5cac9811";
		$str = $P_UserId.'|'.$sdcustomno.'|'.$P_CardId.'|'.$P_CardPass.'|'.$orderAmount.'|'.$P_ChannelId.'|'.$SafeStr;
        $post_key = md5($str);
		$oper_account=$userId;
		$P_Notify_URL='http://'.$_SERVER['SERVER_NAME'].'/zy_agent/payoff_jump.html';
		$P_Result_URL='http://'.$_SERVER['SERVER_NAME'].'/zy_agent/payoff_mobile_callback.html';
		$mark='coinsforplayers';
		$goods_name='包房钻石数';
		if ($type == 1 || $type == "1"){
			$goods_name='自由场酒豆数';
		}		
		
		$url = $domain_url."?P_UserId=".$P_UserId;
        $url.= "&P_OrderId=".$sdcustomno;
        $url.= "&P_CardId=".$P_CardId;
        $url.= "&P_CardPass=".$P_CardPass;
        $url.= "&P_FaceValue=".$orderAmount;
        $url.= "&P_ChannelId=".$P_ChannelId;
        $url.= "&P_Description=".$P_Description;
        $url.= "&P_Price=".$orderAmount;
        $url.= "&P_Quantity=1";
        $url.= "&P_PostKey=".$post_key;
        $url.= "&P_Result_URL=".$P_Result_URL;
        $url.= "&P_Notify_URL=".$P_Notify_URL;
        $url.= "&P_Subject=".$goods_name;
		$order_gems = $goodsNum;
		
		if($oper_account==""){
			login('您好，请先登录');
		}else
		{
			$orderAmount = $money*100;
			M("","","DB_CONFIG0")->execute("insert into yp_apply_order(oper_account,customer_id,order_no,order_money,pay_mode,goods_type,mark,goods_name,sign,order_gems)values('$oper_account','$P_UserId','$sdcustomno','$orderAmount','$P_ChannelId','$type','$mark','$goods_name','$post_key','$order_gems')");
			echo "<script language=\"javascript\">";
			echo "document.location=\"".$url."\"";
			echo "</script>";
		}
	}
?>